﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="EditWorktime.aspx.cs" Inherits="HRProject.Worktime.EditWorktime" %>
<%@ Import Namespace="HRProject.Code.Common" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title><%= ContentProvider.GetString("WorktimeTable") %></title>
    <link type="text/css" href="/css/dialog.css" />
    <link href="/css/worktime.css" rel="stylesheet" type="text/css"/>
    <script type="text/javascript" language="javascript" src="/js/jquery-1.8.2.js"></script>
    <script type="text/javascript" language="javascript" src="/js/worktime.js"></script>
</head>
<body onload="initPage();">
    <form id="form1" runat="server">
    <div>
        <div style="padding:10px 0px 10px 0px;text-align:center;font-weight:bold;font-size:large;color:Blue">BẢNG CHẤM CÔNG</div>
        <table style="width:100%">
            <tr>
                <td class="label"><%= ContentProvider.GetString("FullName") %></td>
                <td class="detail">
                    <label><%= WorktimeRecord.FullName %></label>
                </td>
            </tr>
            <tr>
                <td class="label"><%= ContentProvider.GetString("Date") %></td>
                <td class="detail">
                    <label><%= WorktimeRecord.Property.StartTime.ToString(HRProject.Code.Common.Constant.DateFormat) %></label>
                </td>
            </tr>
            <tr>
                <td valign="top" class="label">
                    <%= ContentProvider.GetString("WorktimeTime") %><br />
                    <img src="../image/layout/AddIcon.png" class="icon-control" alt="" onclick="addWorktime(this)"/>
                </td>
                <td class="detail">
            <% int hh;
               int mm;
               int k;
               for (int i = 0; i < WorktimeRecord.DailyActivities.Count; i++)
               {
                   HRProject.Code.DTO.BLWorktime w = WorktimeRecord.DailyActivities[i];
               %><div>
                   Từ&nbsp;&nbsp;&nbsp;
                    <input type="hidden" name="hdfWorktimeId" value="<%= w.Id %>"/>
                    <select name="cbxStartHour">
                    <% hh = w.StartTime.Hour;
                       mm = w.StartTime.Minute;
                       for (k = 0; k <= 23; k++)
                       { %>
                       <option value="<%= k %>" <%= hh==k?"selected":"" %>><%= k.ToString("00") %></option>
                       <% } %>
                    </select>&nbsp;:
                    <select name="cbxStartMinute">
                    <% for (k = 0; k <= 59; k++)
                       { %>
                       <option value="<%= k %>" <%= mm==k?"selected":"" %>><%= k.ToString("00") %></option>
                    <% } %>
                    </select>&nbsp;&nbsp;&nbsp;đến&nbsp;&nbsp;&nbsp;
                    <select name="cbxEndHour">
                    <% hh = w.EndTime.Hour;
                       mm = w.EndTime.Minute;
                       for (k = 0; k <= 23; k++)
                       { %>
                       <option value="<%= k %>" <%= hh==k?"selected":"" %>><%= k.ToString("00") %></option>
                       <% } %>
                    </select>&nbsp;:
                    <select name="cbxEndMinute">
                    <% for (k = 0; k <= 59; k++)
                       { %>
                       <option value="<%= k %>" <%= mm==k?"selected":"" %>><%= k.ToString("00") %></option>
                    <% } %>
                    </select>
                    <img src="../image/layout/RemoveIcon.png" class="icon-control" alt="" onclick="removeWorktime(this)"/>
                  </div>
            <% } %>
                  <div id="divWorktimeClone" style="display:none">
                   Từ&nbsp;&nbsp;&nbsp;
                    <input type="hidden" name="hdfWorktimeId2" value=""/>
                    <select name="cbxStartHour2">
                    <% for (k = 0; k <= 23; k++)
                       { %>
                       <option value="<%= k %>"><%= k.ToString("00") %></option>
                       <% } %>
                    </select>&nbsp;:
                    <select name="cbxStartMinute2">
                    <% for (k = 0; k <= 59; k++)
                       { %>
                       <option value="<%= k %>"><%= k.ToString("00") %></option>
                    <% } %>
                    </select>&nbsp;&nbsp;&nbsp;đến&nbsp;&nbsp;&nbsp;
                    <select name="cbxEndHour2">
                    <% for (k = 0; k <= 23; k++)
                       { %>
                       <option value="<%= k %>"><%= k.ToString("00") %></option>
                       <% } %>
                    </select>&nbsp;:
                    <select name="cbxEndMinute2">
                    <% for (k = 0; k <= 59; k++)
                       { %>
                       <option value="<%= k %>"><%= k.ToString("00") %></option>
                    <% } %>
                    </select>
                    <img src="../image/layout/RemoveIcon.png" class="icon-control" alt="" onclick="removeWorktime(this)"/>
                  </div>
                  <div id="divRemovedWorktimes" style="display:none"></div>
                </td>
            </tr>
            <tr>
                <td valign="top" class="label"><%= ContentProvider.GetString("Description") %></td>
                <td class="detail">
                    <textarea name="txaDescription" style="width:300px;height:100px"><%= WorktimeRecord.Property.Description %></textarea>
                </td>
            </tr>
            <tr>
                <td class="label"></td>
                <td class="detail">
                    <input type="checkbox" name="ckbIsApproved" value="1" <%= WorktimeRecord.Property.Approved?"checked=\"checked\"":"" %>/><%= ContentProvider.GetString("HasLeaveApplication") %>
                    <input type="hidden" name="hdfWorktimePropertyId" value="<%= WorktimeRecord.Property.Id %>" />
                </td>
            </tr>
            <tr>
                <td class="label"></td>
                <td class="detail">
                    <asp:Button ID="btnOK" runat="server" onclick="btnOK_Click"/>
                    <input type="button" name="btnCancel" value="<%= ContentProvider.GetString("Cancel") %>"
                        onclick="window.close();"/>
                    <br /><br />
                    <asp:Label ID="lblError" runat="server" Text="" ForeColor="Red"></asp:Label>
                </td>
            </tr>
        </table>
    </div>
    </form>
</body>
</html>
